<?php
if(!defined('IN_ORA')) {
	exit('Access Denied');
}
session_start();
$GLOBALS['__page_cache__'] = true;
$act = $GLOBALS['act'] ==""?"index":$GLOBALS['act'];
$GLOBALS['tpl']->assign('act',$act);
if($act == "index"){
	if(!$GLOBALS['tpl']->isCached("index-index")){
		/** 站点信息 **/
		$GLOBALS['tpl']->assign('sinfo',$GLOBALS['db']->getOne('select * from '.tn('info').' order by Id asc limit 1'));
		
		/** 导航信息 **/
		$GLOBALS['tpl']->assign('navs',$GLOBALS['db']->getAll('select * from '.tn('nav').' order by nav_sort asc limit 6'));
		
		/** 动态信息 **/
		import("lib.art");
		$GLOBALS['tpl']->assign('arts',art_lib::getArt(7,array('status'=>1),"order by dateline desc"));
		
		/** 产品信息 **/
		$sql = 'select op.Id,op.pro_name,op.pro_keywords,op.pro_pic,oc.cat_name,op.cat_id from '.tn("product").' op left join '.tn("cat").' oc on op.cat_id = oc.Id where op.pro_status =1  order by op.Id desc limit 20';
		$GLOBALS['tpl']->assign('pros',$GLOBALS['db']->getAll($sql));
		
		/** 关于我们 **/
		$sql = "select ops.*,op.content from ".tn('pages')." ops  left join ".tn('page')." op on op.pid = ops.Id where ops.name='关于我们'";
		$GLOBALS['tpl']->assign('aboutus',$GLOBALS['db']->getOne($sql));
		
		/** 产品分类 **/
		import("lib.cat");
		$GLOBALS['tpl']->assign('cates',cat_lib::getSubChild(0,2,' and cat_type=1'));
		
		/** 当前位置 **/
		$local = array();
		$local[] = array('url'=>parse_uri('index-index'),'text'=>'首页');
		$GLOBALS['tpl']->assign('local',$local);
	}
	$GLOBALS['tpl']->display("index.html");
}
?>